<?php

/**
 * Libretaentrega form base class.
 *
 * @method Libretaentrega getObject() Returns the current form's model object
 *
 * @package    courier
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseLibretaentregaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'len_id'           => new sfWidgetFormInputHidden(),
      'len_avecalle'     => new sfWidgetFormInputText(),
      'len_residcasa'    => new sfWidgetFormInputText(),
      'len_aptonumcasa'  => new sfWidgetFormInputText(),
      'len_urbanizacion' => new sfWidgetFormInputText(),
      'len_ciudad'       => new sfWidgetFormInputText(),
      'len_pais'         => new sfWidgetFormInputText(),
      'len_codpostal'    => new sfWidgetFormInputText(),
      'len_latitud'      => new sfWidgetFormInputText(),
      'len_longitud'     => new sfWidgetFormInputText(),
      'len_nomdireccion' => new sfWidgetFormInputText(),
      'len_cliente'      => new sfWidgetFormPropelChoice(array('model' => 'Cliente', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'len_id'           => new sfValidatorChoice(array('choices' => array($this->getObject()->getLenId()), 'empty_value' => $this->getObject()->getLenId(), 'required' => false)),
      'len_avecalle'     => new sfValidatorString(array('max_length' => 50)),
      'len_residcasa'    => new sfValidatorString(array('max_length' => 50)),
      'len_aptonumcasa'  => new sfValidatorString(array('max_length' => 50)),
      'len_urbanizacion' => new sfValidatorString(array('max_length' => 50)),
      'len_ciudad'       => new sfValidatorString(array('max_length' => 50)),
      'len_pais'         => new sfValidatorString(array('max_length' => 50)),
      'len_codpostal'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'len_latitud'      => new sfValidatorNumber(),
      'len_longitud'     => new sfValidatorNumber(),
      'len_nomdireccion' => new sfValidatorString(array('max_length' => 25)),
      'len_cliente'      => new sfValidatorPropelChoice(array('model' => 'Cliente', 'column' => 'cli_id')),
    ));

    $this->widgetSchema->setNameFormat('libretaentrega[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Libretaentrega';
  }


}
